package v1.com.autoresource;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import v1.com.autoresource.service.OrderService;
import v1.com.autoresource.utils.BeanConstext;

/**
 * @ProjectName: learning
 * @Package: com.autoresource
 * @ClassName: AutoSelectDataResourceApplication
 * @Description:
 * @Date: 2021/11/1 7:28 下午
 * @Version: 1.0
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = "v1.com.autoresource")
public class AutoSelectDataResourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(AutoSelectDataResourceApplication.class, args);
        OrderService orderService = BeanConstext.getBean(OrderService.class);
        long s1 = System.currentTimeMillis();
      //  orderService.batchInsertOrder();
        orderService.batchInsert();
        long s2 = System.currentTimeMillis();
        System.out.println("cost time=>>" + (s2 - s1));
        //  List<TbOrder> tbOrders = orderService.batchQueryByIds(1000, 10000);
        //  System.out.println(tbOrders);

    }
}
